hackerrank ruby enumerable each with index problem solution

visit shbcf.ru